package com.aaa.system.controller.api;

import com.aaa.entity.Dept;
import com.aaa.entity.DictData;
import com.aaa.system.service.DeptService;
import com.aaa.system.service.DictDataService;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: his-open-parent
 * @description:
 * @author: 闫克起2
 * @create: 2023-03-21 11:15
 **/
@RestController
@RequestMapping("/system/api/dict/data")
public class ApiDictDataController {

    @Autowired
    private DictDataService dictDataService;

    @GetMapping("findByType/{type}")
    public Result<List<DictData>> list(@PathVariable String type){
        return dictDataService.findByType(type);
    }
    @GetMapping("cacheAsync")
    public Result<String> cacheAsync(){
        return dictDataService.cacheAsync();
    }
}
